package com.yunqian.util;

import org.apache.commons.lang3.StringUtils;

import java.util.Random;

/**
 * @author czy
 * @describe
 * @date 2018/7/31
 */
public class RandomUtil {

    public static String fourDigit(){
        Random random =new Random();
        return StringUtils.substring(String.valueOf(random.nextInt()* -10), 2, 6);
    }

    public static String sixDigit(){
        Random random =new Random();
        return StringUtils.substring(String.valueOf(random.nextInt() * -10), 2, 8);
    }

    public static String messageCode(){
        Random random =new Random();
        return String.valueOf((int)(Math.random() * 9000 + 1000));
    }
}
